"""
@author: gaoyx
@date: 2021-12-24 11:35:25
"""
<!-- 通知公告查询 -->
<template>
  <base-layout title="通知公告查询">
    <search :isShow.sync="show" @search="onSearch" />
    <list v-show="!show" ref="list" #default="{ data }">
      <div
        class="list-item"
        @click="$router.push(`/notice/detail/${data.strId}`)"
      >
        <p>{{ data.strTitle }}</p>
        <span>{{ data.dtPubDate }}</span>
        <span>{{ data.strPubUnit }}</span>
      </div>
    </list>
  </base-layout>
</template>

<script>
import { zBNoticeMainApi } from 'api/server.js'
export default {
  name: 'noticeSearch',
  data() {
    return {
      show: true
    }
  },
  methods: {
    onSearch(keywords) {
      if (keywords !== '') {
        this.$refs.list.$getList(zBNoticeMainApi, { keywords, intCurPage: 1 })
        this.show = false
        this.$store.commit('addInclude', 'noticeSearch')
      } else {
        this.show = true
      }
    }
  }
}
</script>

<style lang='scss' scoped>
::v-deep .van-list {
  width: 100%;
  height: calc(100% - 54px);
  overflow: auto;
  margin-bottom: 33px;
  background-color: #fff;
}
.list-item {
  min-height: 86px;
  font-size: 18px;
  line-height: 28px;
  margin: 16px 23px 0px 23px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f7f7f7;
  p {
    margin: 0px;
    font-size: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  span {
    display: inline-block;
    line-height: 28px;
    color: #999;
    font-size: 13px;
    margin-right: 16px;
  }
}
</style>